<template>
  <div class="upload">
    <div class="upload-container">
      <div class="upload-title">
        <span class="page-name" v-if="showPage == 'my-app'">我的应用</span>
        <span class="page-name" v-if="showPage == 'app-market'">应用市场</span>
      </div>
      <div class="upload-header">
        <div class="btn-design" v-if="showPage == 'my-app'">
          <i class="icon icon-upload"></i>直接上传
        </div>
        <div class="btn-design" v-if="showPage == 'my-app'" @click="changePage('app-market')">
          <i class="icon icon-application"></i>从应用市场添加
        </div>
        <div class="btn-design btn-links" v-if="showPage == 'my-app'">
          <i class="icon icon-link"></i>添加应用下载链接
          <i class="red">New</i>
        </div>

        <div class="btn-design" v-if="showPage == 'app-market'">
          <i class="icon icon-add"></i>加到我的应用
        </div>
        <div
          class="btn-design btn-reback"
          v-if="showPage == 'app-market'"
          @click="changePage('my-app')"
        >
          <i class="icon icon-reback"></i>返回
        </div>

        <div class="input-design">
          <span>应用名称:</span>
          <input type="text">
        </div>
        <div class="input-design">
          <span>APPID:</span>
          <input type="text">
        </div>
        <div class="btn-search">搜索</div>
      </div>
      <div class="upload-body">
        <div class="table-scroll">
          <table class="table-stripe table-cover" v-if="showPage == 'my-app'">
            <thead>
              <tr>
                <th>
                  <input type="checkbox">
                </th>
                <th>云机ID</th>
                <th>云机备注</th>
                <th>云机ssss类型</th>
                <th>状态</th>
                <th>到期时间</th>
                <th>应用安装数量</th>
              </tr>
            </thead>
            <tbody>
              <tr v-for="list in lists">
                <td>
                  <input type="checkbox">
                </td>
                <td>sca</td>
                <td>sacs</td>
                <td>wsc</td>
                <td>scac</td>
                <td>wwww</td>
                <td>www</td>
              </tr>
            </tbody>
            <tfoot>
              <tr>
                <td colspan="8">共 0 条记录 首页 上一页 下一页 尾页 页次:1/0页 50条/页</td>
              </tr>
            </tfoot>
          </table>

          <table class="table-stripe table-cover" v-if="showPage == 'app-market'">
            <thead>
              <tr>
                <th>
                  <input type="checkbox">
                </th>
                <th>应用名称</th>
                <th>APK名称</th>
                <th>包名</th>
                <th>版本号</th>
                <th>APPID</th>
              </tr>
            </thead>
            <tbody>
              <tr v-for="list in lists">
                <td>
                  <input type="checkbox">
                </td>
                <td>sca</td>
                <td>wsc</td>
                <td>scac</td>
                <td>wwww</td>
                <td>www</td>
              </tr>
            </tbody>
            <tfoot>
              <tr>
                <td colspan="7">共 0 条记录 首页 上一页 下一页 尾页 页次:1/0页 50条/页</td>
              </tr>
            </tfoot>
          </table>
        </div>
      </div>
    </div>
  </div>
</template>

<script>
export default {
  data() {
    return {
      showPage: "my-app",
      lists: [{}, {}, {}]
    };
  },
  methods: {
    changePage(page) {
      this.showPage = page;
    }
  }
};
</script>

<style lang="scss" scoped>
$primary: #007bff;
$white-light: #f5f6f7;
$white-hover: #fafbfc;
$gray-border: #c3c6c9;
.upload,
.upload-container {
  position: relative;
  height: 100%;
  width: 100%;
}
.upload-title {
  width: 100%;
  padding: 5px 10px;
  box-sizing: border-box;
  border-bottom: 1px solid $gray-border;
}
.upload-header {
  width: 100%;
  padding: 0px 10px 5px;
  box-sizing: border-box;
  border-bottom: 1px solid $gray-border;
}
.btn-design {
  display: inline-block;
  cursor: pointer;
  padding: 0 5px;
  font-size: 14px;
  margin-top: 8px;
  margin-right: 5px;
  border-radius: 5px;
  background-color: $white-light;
  border: 1px solid $gray-border;
  &:hover {
    background-color: $white-hover;
  }
}
.icon {
  line-height: 20px;
  margin-right: 2px;
  margin-left: 2px;
  &:before {
    font-size: 14px;
  }
}
.icon-upload:before {
  content: "\e775";
}
.icon-application:before {
  content: "\e603";
}
.icon-link:before {
  content: "\e6b2";
}
.icon-add:before {
  content: "\e642";
}
.icon-reback:before {
  content: "\e6b1";
}
.btn-links,
.btn-reback {
  margin-right: 30px;
}
.red {
  margin-left: 5px;
  font-weight: bold;
}
.input-design {
  margin-top: 8px;
  display: inline-block;
  input {
    padding: 0 5px;
    width: 150px;
    border: 1px solid;
    height: 26px;
    border-radius: 3px;
  }
}
.btn-search {
  display: inline-block;
  cursor: pointer;
  padding: 5px 10px;
  font-size: 15px;
  margin-top: 4px;
  margin-right: 5px;
  border-radius: 5px;
  background-color: $white-light;
  border: 1px solid $gray-border;
  &:hover {
    background-color: $white-hover;
  }
}
.upload-body {
  padding: 10px 10px 150px;
  height: 100%;
  width: 100%;
  overflow: auto;
}
</style>